package com.apigen.platform.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.Builder;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * 模板视图对象
 *
 * @author API Generator Platform
 * @since 2025-09-24
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "模板信息")
public class TemplateVO {

    @Schema(description = "模板ID", example = "1")
    private Long templateId;

    @Schema(description = "模板名称", example = "Spring Boot Admin Template")
    private String templateName;

    @Schema(description = "模板编码", example = "spring-boot-admin")
    private String templateCode;

    @Schema(description = "模板描述", example = "基于Spring Boot的后台管理系统模板")
    private String description;

    @Schema(description = "模板类型", example = "BACKEND")
    private String templateType;

    @Schema(description = "技术栈", example = "Spring Boot + MyBatis Plus + Vue 3")
    private String techStack;

    @Schema(description = "适用场景", example = "后台管理系统、企业级应用")
    private String useCase;

    @Schema(description = "模板版本", example = "1.0.0")
    private String version;

    @Schema(description = "作者", example = "API Generator Team")
    private String author;

    @Schema(description = "许可证", example = "MIT")
    private String license;

    @Schema(description = "官网地址", example = "https://example.com")
    private String homepage;

    @Schema(description = "Git仓库地址", example = "https://gitee.com/example/template")
    private String repositoryUrl;

    @Schema(description = "演示地址", example = "https://demo.example.com")
    private String demoUrl;

    @Schema(description = "文档地址", example = "https://docs.example.com")
    private String documentUrl;

    @Schema(description = "封面图片", example = "/images/template-cover.jpg")
    private String coverImage;

    @Schema(description = "截图列表")
    private List<String> screenshots;

    @Schema(description = "标签列表")
    private List<String> tags;

    @Schema(description = "是否启用", example = "true")
    private Boolean isEnabled;

    @Schema(description = "是否推荐", example = "false")
    private Boolean isRecommended;

    @Schema(description = "排序", example = "100")
    private Integer sortOrder;

    @Schema(description = "下载次数", example = "1250")
    private Integer downloadCount;

    @Schema(description = "评分", example = "4.8")
    private Double rating;

    @Schema(description = "评价数量", example = "156")
    private Integer reviewCount;

    @Schema(description = "创建者ID", example = "1000")
    private Long creatorId;

    @Schema(description = "创建者名称", example = "admin")
    private String creatorName;

    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    @Schema(description = "最后下载时间")
    private LocalDateTime lastDownloadTime;

    @Schema(description = "模板配置")
    private Map<String, Object> templateConfig;

    @Schema(description = "依赖配置")
    private Map<String, Object> dependencies;

    @Schema(description = "特性列表")
    private Map<String, Object> features;

    @Schema(description = "模板统计信息")
    private TemplateStatistics statistics;

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @Schema(description = "模板统计信息")
    public static class TemplateStatistics {

        @Schema(description = "今日下载量", example = "25")
        private Integer todayDownloads;

        @Schema(description = "本周下载量", example = "180")
        private Integer weekDownloads;

        @Schema(description = "本月下载量", example = "720")
        private Integer monthDownloads;

        @Schema(description = "使用项目数", example = "89")
        private Integer projectCount;

        @Schema(description = "活跃用户数", example = "156")
        private Integer activeUsers;

        @Schema(description = "最新版本", example = "1.2.3")
        private String latestVersion;

        @Schema(description = "更新频率", example = "每月")
        private String updateFrequency;
    }
}










